<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${ctxStatic}/jquery-easyui-1.4.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctxStatic}/jquery-easyui-1.4.5/themes/icon.css">
<script type="text/javascript" src="${ctxStatic}/jquery-easyui-1.4.5/jquery.min.js"> </script>
<script type="text/javascript" src="${ctxStatic}/jquery-easyui-1.4.5/jquery.easyui.min.js"> </script>
<script type="text/javascript" src="${ctxStatic}/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"> </script>  
<title>TREEGRID DIALOG</title>
</head>
<body>
	<form id="treegridForm" method="post">
		<table id="tt" style="width:600px;height:400px"></table>
	</form>
	<script type="text/javascript">
	$('#tt').treegrid({    
	    url:'${mainPath}/treejson',    
	    idField:'id',    
	    treeField:'text', 
	    rownumbers:true,
	    columns:[[        
	        {field:'text',title:'名称',width:240},
	        {field:'id',title:'编号',width:80},
	        {field:'operadep',title:'操作',width:180,resizable:true,
	           	formatter:function(value,row,index){ //val指当前单元格的值,row,当前行对象,index当前行的索引
	           		var btn = '<form class="operForm" method="post"><a href="#" name="editdep" class="easyui-linkbutton" onclick="editRow('+index+')" ></a>'+
	           		'<a href="#" name="opuser" class="easyui-linkbutton" onclick="opuserRow('+index+')" ></a>'+
	           		'<a href="#" name="oprole" class="easyui-linkbutton" onclick="oproleRow('+index+')" ></a></form>';  
	           		return btn;  
	           	}
	        },
	    ]],
	    onLoadSuccess:function(data){  
            $("a[name='editdep']").linkbutton({text:'编辑',plain:true,iconCls:'icon-page-edit'});
            $("a[name='opuser']").linkbutton({text:'用户',plain:true,iconCls:'icon-user'});
            $("a[name='oprole']").linkbutton({text:'角色',plain:true,iconCls:'icon-group'});
            $('.tabview').datagrid('fixRowHeight');//解决错位固定行错位
     } ,
	}); 
	</script>

</body>
</html>